package com.songshuai.webapi.crm.util;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class PageUtil {

    private Integer pageNum = 1;

    private Integer pageSize = 20;

    private Integer start;

    private Integer end;

    //总条数
    private Integer totalSize;
    //总页数
    private Integer totalPageNum;

    //集合
    private Object lists;

    public PageUtil(Integer pageNum, Integer pageSize, Integer totalSize){



        if(pageNum != null){
            this.pageNum = pageNum;
        }

        if(pageSize != null){
            this.pageSize = pageSize;
        }

        this.start = (this.pageNum-1) * this.pageSize;
        this.end = this.pageSize;

        this.totalSize = totalSize;

        this.totalPageNum = (this.totalSize + this.pageSize -1)  / this.pageSize;



    }






}
